/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cinemasystem.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

/**
 *
 * @author given
 */
@Entity
public class Archive implements Serializable {
    
    private String movieName;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date datePublished;
    private String description;
    private String nameOfdistributor;
    private Long movieDuration;
    
    @ManyToOne
    @JoinColumn(name="movieTechnology_ID")
    private MovieTechnology movieTechnology;


    public Date getDatePublished() {
        return datePublished;
    }

    public void setDatePublished(Date datePublished) {
        this.datePublished = datePublished;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getMovieName() {
        return movieName;
    }

    public void setMovieName(String movieName) {
        this.movieName = movieName;
    }

    public MovieTechnology getMovieTechnology() {
        return movieTechnology;
    }

    public void setMovieTechnology(MovieTechnology movieTechnology) {
        this.movieTechnology = movieTechnology;
    }

    public String getNameOfdistributor() {
        return nameOfdistributor;
    }

    public void setNameOfdistributor(String nameOfdistributor) {
        this.nameOfdistributor = nameOfdistributor;
    }

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Archive)) {
            return false;
        }
        Archive other = (Archive) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.cinemasystem.model.Discard[ id=" + id + " ]";
    }

    public void setMovieDuration(Long movieDuration) {
        this.movieDuration = movieDuration;
    }

    public Long getMovieDuration() {
        return this.movieDuration;
    }

}
